#!/bin/bash
#自动化安装k8s集群

echo -e "\033[33m-------------------------获取token---------------------------\033[0m"
#kubeadm token create --ttl=0 --print-join-command
a=`kubeadm token list | awk '/<never>/{print $1}'`
b=`openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt |openssl rsa -pubin -outform der |openssl dgst -sha256 -hex |awk '{print $2}'`
echo -e "\033[32mToken:${a}\033[0m"
echo -e "\033[32msha256:${b}\033[0m"
echo -e "\033[32m 把相对应的值写入到ansible目录下，node_install.yaml>文件中\033[0m"
